import java.io.*;

public class Demo7 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("d:/text.txt")){
            PrintWriter writer = new PrintWriter(outputStream);
            writer.println("fsaf");
            writer.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
